@extends('layouts.app')
@section('title','已预约订单')
@section('content')

<!-- start: Content -->
<div class="row-fluid">
	<div class="box span12">
		<div class="box-header">
			<h2><i class="icon-edit"></i>已预约订单</h2>
		</div>
		<div class="box-content">
			<table class="table table-hover">
			<thead>
			  	<tr>
				  	<th style='width:2%;'>
						<!-- <input id="mychk" type="checkbox" name="id[]" value=""> -->
				  	</th>
					<th style='width:20%;'>服务项目</th>
					<th style='width:4%'>单价(元)</th>
					<th style='width:8%;'>数量</th>
					<th style='width:8%;'>手机号</th>
					<th style='width:8%;'>交易状态</th>
					<th style='width:8%;'>操作</th>
			  	</tr>
			</thead>   
			<tbody>
				@foreach($order as $ov)
					<th colspan="7">
						 <input id="mychk" type="checkbox" name="id[]" value="{{ $ov->id }}">&nbsp;&nbsp;&nbsp;&nbsp;
						订单号：{{ $ov->order_number }}&nbsp;&nbsp;&nbsp;&nbsp;
						下单时间：{{ $ov->created_at }}&nbsp;&nbsp;&nbsp;&nbsp;
						关闭订单倒计时：{{ $ov->created_at }}
					</th>
					<tr>
						<td></td>
						<td class="center">
							<img src="{{ $ov->path }}"style='width:185px;height:75px;float:left;margin-right: 10px;'>
							<div style='float:left;'>
								<span style='float:left;font-weight:bold;'>{{ $ov->title }}</span><br>
								<p style='float:left;width:225px;'>
									{{ $ov->commit }}
								</p>
							</div>
						</td>
						<td class="center" style='line-height: 70px;'>{{ $ov->money }}</td>
						<td class="center" style='line-height: 70px;'>{{ $ov->num }}</td>
						<td class="center" style='line-height: 70px;'>{{ $ov->mobile }}</td>
						<td class="center" style='line-height: 30px;'>
							{{ $ov->order_status }} <br>
							@if($ov->serve_status == 0)
								<span style='color:red;'>未服务</span>
							@elseif($ov->serve_status == 1)
								@if($ov->u_score == null)
									<span style='color:red;'>等待用户评价</span>
								@else
									<span style='color:red;'>用户已评</span>
								@endif
							@elseif($ov->serve_status == 2)
								<span style='color:red;'>用户已评</span>
							@elseif($ov->serve_status == 3)
								<span style='color:red;'>双方已评</span>
							@endif
						</td>
						<td class="center" style='line-height: 30px;'>
							<a class="btn btn-danger" href='{{ URL("app/order/stay/$ov->id/edit") }}'>
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;查看&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							</a><br>
							@if($ov->serve_status == 0)
							<a class="btn btn-primary" href='{{ URL("app/order/make/$ov->id/edit") }}'>
								确认服务
							</a>
							@endif
						</td>
					</tr>
				@endforeach
			  </tbody>
		  </table>
		  <div class="dataTables_paginate paging_bootstrap pagination">
		  	<ul>
		  		 {{ $order->links() }}
		  	</ul>
			</div>
		</div>
	</div><!--/span-->
</div><!--/row-->

@stop
